<!DOCTYPE html>

<html lang="zh-CN">

    <head>

        <meta charset="utf-8">

        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

        <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->

        <meta name="format-detection" content="telephone=no" />

		<!-- 禁止数字识自动别为电话号码 -->

        <title>{__WECHAT_NAME__}注册</title>

        <link rel="stylesheet" href="{__TLP__}css/zc-dl.css">

		<script language="javascript" type="text/javascript">

			var PW_PATH='{__PW_PATH__}';

		</script>

        <script src="{__TLP__}js/jquery-2.1.3.min.js"></script>

        <script src="{__PW_PATH__}statics/core.js" language="javascript"></script>

		<script language="javascript" type="text/javascript">

        document.getElementsByTagName("html")[0].style.fontSize=document.documentElement.clientWidth/16+"px";
		
		{if intval($PW['member_register_checktype'])}
		var wait=30; 

		function time() {  

			if (wait == 0) {  

				$('#djs').removeClass('r_inp_b_dis');

				$('#djs').attr("disabled",false);            

				$('#djs').text("获取验证码");  

				wait = 30;  

			} else {  

				$('#djs').attr("disabled", true);  

				$('#djs').text("重新发送(" + wait + ")");  

				wait--;  

				setTimeout(function() {  

					time();  

				},  

				1000) 

			}  

		}  

		{/if}

		$(document).ready(function(){
			{if intval($PW['member_register_checktype'])}
			$('#djs').click(function(){

				if($('#djs').attr("disabled"))

				{

					return false;

				}

				else

				{

					$.post('{__SITE_URL__}api/sms/index.php?telephone='+$("#telephone").val(), function(data) {

						if(data=='2')

						{

							$('#djs').addClass('r_inp_b_dis');

							time();

						}

						else

						{

							showToast('短信发送失败，请重试['+data+']',false);

						}

					});

					

				}

			});

			{/if}

			$('#dosubmit').click(function(){

				

				$.post('{U(MOD,'register')}', $("#registerform").serialize(), function(data) {

					if(data=='success')

					{

						showToast('注册成功','{htmlspecialchars_decode(get_cookie("redirect"))}');

					}

					else if(data<0)

					{

						if(data==-2 || data==-7)

						{

							showToast('该手机号已注册',false);

						}

						else

						{

							showToast('错误异常，注册失败['+data+']',false);

						}

					}

					else

					{

						msg=$("#"+data).attr("msg");

						

						showToast(msg,false);

					}

				});

			});

		});

        </script>

        

        <style>

        ::-webkit-input-placeholder { /* WebKit browsers */color:#ccc;}

        :-moz-placeholder { /* Mozilla Firefox 4 to 18 */color:#ccc;}

        ::-moz-placeholder { /* Mozilla Firefox 19+ */color:#ccc;}

        :-ms-input-placeholder { /* Internet Explorer 10+ */color:#ccc;}

        a:link,a:visited,a:hover{

        text-decoration: none;

        color: none;

        }

        a:active{

           color: none; 

        }
		
		.check-code{float: right;cursor: pointer;margin-right: .7rem; margin-top: 1.08rem;width: 85px;}
        </style>

    </head>

    <body style="background: #f9f8f9;">

       <form action="{U(MOD,'register')}" name="registerform" id="registerform" target="target" method="post">

            <input type="hidden" name="dosubmit" value="1">

            <input type="hidden" name="redirect" value="{$redirect}">

            <div class="r_m">

                <input class="inp r_inp" type="text" name="telephone" id="telephone" msg="手机号不正确或已被注册" placeholder="请输入手机号">

                <input class="inp r_inp_y" type="text" name="smscode" id="smscode" msg="验证码不正确" placeholder="请输入验证码">
				{if intval($PW['member_register_checktype'])}
                <a class="r_inp_b" href="javascript:void(0);" id="djs">获取验证码</a> 
				{else}
				<img src="{__PW_PATH__}api/captcha/index.php?t={mt_rand()}" id="captchaimg"  onClick="getCaptcha('captchaimg')" class="check-code">
				{/if}
                <input class="inp r_inp" type="password" name="userpwd" id="userpwd" msg="密码由6-32位字符组成" placeholder="请输入密码">

                <input class="inp r_inp" type="password" name="reuserpwd" id="reuserpwd" msg="两次密码输入不一致" placeholder="确认密码">

            </div>            

            <div class="jy_ann">

                <input class="sub dj_z" type="button" id="dosubmit" value="注册账号">

            </div>

        </form>

        <div class="r_lj">

            <a class="r_dl fl" href="{U(MOD,'login',array('redirect'=>$redirect))}">已有账号，登录</a>

            <a class="r_wm fr" href="{U(MOD,'getpwd',array('redirect'=>$redirect))}">忘记密码?</a>

        </div>

    </body>





   <script type="text/javascript">

$(function(){

    document.body.addEventListener('touchstart', function () {

         //...空函数即可

        });  

    

});



</script>

</html>

